<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>约会详情 - 社交平台</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/ajax/ajaxfonts/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #3b82f6;
            --primary-light: #93c5fd;
            --primary-dark: #1d4ed8;
            --secondary: #f97316;
            --success: #10b981;
            --danger: #ef4444;
            --light-bg: #f8fafc;
            --card-bg: #ffffff;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --border-color: #e2e8f0;
            --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
            --transition: all 0.2s ease;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--light-bg);
            color: var(--text-primary);
            padding-top: 56px;
            padding-bottom: 65px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: var(--card-bg);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            border-bottom: 1px solid var(--border-color);
            z-index: 1000;
        }
        
        .nav-title {
            font-size: 1.1rem;
            font-weight: 600;
        }
        
        .nav-btn {
            background: none;
            border: none;
            color: var(--text-secondary);
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }
        
        .nav-btn:hover {
            background-color: var(--light-bg);
            color: var(--primary);
        }
        
        /* 图片轮播 */
        .image-slider {
            position: relative;
            height: 250px;
            overflow: hidden;
        }
        
        .slider-item {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            opacity: 0;
            transition: opacity 0.5s ease;
        }
        
        .slider-item.active {
            opacity: 1;
        }
        
        .slider-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .slider-indicators {
            position: absolute;
            bottom: 12px;
            left: 0;
            right: 0;
            display: flex;
            justify-content: center;
            gap: 6px;
        }
        
        .slider-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.6);
        }
        
        .slider-dot.active {
            background-color: white;
            width: 24px;
            border-radius: 4px;
        }
        
        .image-count {
            position: absolute;
            top: 12px;
            right: 12px;
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
            padding: 3px 8px;
            border-radius: 12px;
            font-size: 0.8rem;
        }
        
        /* 约会详情卡片 */
        .date-card {
            background-color: var(--card-bg);
            border-radius: 16px 16px 0 0;
            margin-top: -24px;
            padding: 20px 16px 16px;
            position: relative;
        }
        
        .date-status {
            position: absolute;
            top: -10px;
            right: 16px;
            background-color: var(--success);
            color: white;
            padding: 3px 10px;
            border-radius: 12px;
            font-size: 0.8rem;
            font-weight: 500;
        }
        
        .date-title {
            font-size: 1.3rem;
            font-weight: 700;
            margin-bottom: 12px;
        }
        
        .host-info {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 16px;
        }
        
        .host-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .host-name {
            font-weight: 600;
        }
        
        .host-badge {
            background-color: rgba(59, 130, 246, 0.1);
            color: var(--primary);
            font-size: 0.7rem;
            padding: 1px 6px;
            border-radius: 6px;
        }
        
        .date-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 12px 16px;
            margin-bottom: 16px;
            font-size: 0.9rem;
        }
        
        .meta-item {
            display: flex;
            align-items: center;
            gap: 6px;
            color: var(--text-secondary);
        }
        
        .meta-item i {
            color: var(--primary);
            width: 20px;
        }
        
        .date-description {
            font-size: 0.95rem;
            line-height: 1.6;
            margin-bottom: 16px;
            color: var(--text-primary);
        }
        
        .date-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 16px;
        }
        
        .date-tag {
            padding: 4px 12px;
            background-color: rgba(59, 130, 246, 0.1);
            color: var(--primary);
            border-radius: 16px;
            font-size: 0.8rem;
        }
        
        /* 操作按钮区 */
        .action-buttons {
            display: flex;
            gap: 10px;
            padding: 12px 16px;
            background-color: var(--card-bg);
            border-top: 1px solid var(--border-color);
            position: sticky;
            top: 56px;
            z-index: 900;
        }
        
        .action-btn {
            flex: 1;
            padding: 10px 0;
            border-radius: 10px;
            font-weight: 500;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: var(--transition);
        }
        
        .primary-action {
            background-color: var(--primary);
            color: white;
            border: none;
        }
        
        .primary-action:hover {
            background-color: var(--primary-dark);
        }
        
        .secondary-action {
            background-color: transparent;
            border: 1px solid var(--primary);
            color: var(--primary);
        }
        
        .icon-action {
            width: 44px;
            height: 44px;
            padding: 0;
            border-radius: 50%;
            background-color: var(--light-bg);
            color: var(--text-secondary);
            border: none;
        }
        
        /* 内容标签页 */
        .content-tabs {
            display: flex;
            background-color: var(--card-bg);
            border-bottom: 1px solid var(--border-color);
        }
        
        .content-tab {
            flex: 1;
            padding: 14px 0;
            text-align: center;
            font-size: 0.95rem;
            font-weight: 500;
            color: var(--text-secondary);
            position: relative;
            cursor: pointer;
        }
        
        .content-tab.active {
            color: var(--primary);
        }
        
        .content-tab.active::after {
            content: '';
            position: absolute;
            bottom: -1px;
            left: 0;
            right: 0;
            height: 3px;
            background-color: var(--primary);
            border-radius: 3px 3px 0 0;
        }
        
        .content-panel {
            display: none;
            padding: 16px;
            background-color: var(--card-bg);
        }
        
        .content-panel.active {
            display: block;
        }
        
        /* 参与者列表 */
        .participants-list {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
            margin-bottom: 16px;
        }
        
        .participant-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }
        
        .participant-avatar {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            object-fit: cover;
            margin-bottom: 6px;
            border: 2px solid transparent;
        }
        
        .participant-item.host .participant-avatar {
            border-color: var(--primary);
        }
        
        .participant-name {
            font-size: 0.8rem;
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            width: 100%;
        }
        
        .participant-status {
            font-size: 0.7rem;
            color: var(--text-secondary);
        }
        
        /* 详情信息 */
        .detail-section {
            margin-bottom: 20px;
        }
        
        .detail-title {
            font-weight: 600;
            margin-bottom: 8px;
            font-size: 1.05rem;
        }
        
        .detail-content {
            font-size: 0.9rem;
            color: var(--text-secondary);
            line-height: 1.6;
        }
        
        .location-map {
            width: 100%;
            height: 180px;
            background-color: var(--light-bg);
            border-radius: 10px;
            margin: 10px 0;
            overflow: hidden;
            position: relative;
        }
        
        .location-map img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .map-pin {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -100%);
            color: var(--danger);
            font-size: 1.8rem;
        }
        
        /* 留言区 */
        .comments-section {
            padding-bottom: 20px;
        }
        
        .comment-input-container {
            display: flex;
            gap: 10px;
            padding: 12px 16px;
            background-color: var(--card-bg);
            border-top: 1px solid var(--border-color);
            position: sticky;
            bottom: 65px;
            z-index: 900;
        }
        
        .comment-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            object-fit: cover;
            flex-shrink: 0;
        }
        
        .comment-input-wrapper {
            flex: 1;
            position: relative;
        }
        
        .comment-input {
            width: 100%;
            padding: 10px 40px 10px 12px;
            border-radius: 20px;
            border: 1px solid var(--border-color);
            background-color: var(--light-bg);
            font-size: 0.9rem;
        }
        
        .send-comment {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: var(--primary);
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .comments-list {
            margin-top: 10px;
        }
        
        .comment-item {
            display: flex;
            gap: 10px;
            padding: 12px 0;
            border-bottom: 1px solid var(--border-color);
        }
        
        .comment-content {
            flex: 1;
        }
        
        .comment-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 4px;
        }
        
        .comment-author {
            font-weight: 500;
            font-size: 0.9rem;
        }
        
        .comment-time {
            font-size: 0.75rem;
            color: var(--text-secondary);
        }
        
        .comment-text {
            font-size: 0.9rem;
            margin-bottom: 6px;
        }
        
        .comment-actions {
            display: flex;
            gap: 16px;
            font-size: 0.8rem;
        }
        
        .comment-action {
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 4px;
            background: none;
            border: none;
        }
        
        .comment-action:hover {
            color: var(--primary);
        }
        
        /* 回复区 */
        .replies-list {
            margin-left: 46px;
            margin-top: 8px;
        }
        
        .reply-item {
            display: flex;
            gap: 8px;
            padding: 8px 0;
        }
        
        .reply-content {
            background-color: var(--light-bg);
            padding: 8px 12px;
            border-radius: 12px;
            font-size: 0.85rem;
        }
        
        .reply-author {
            font-weight: 500;
        }
        
        .reply-text {
            margin-top: 2px;
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 65px;
            background-color: var(--card-bg);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-color);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--text-secondary);
            font-size: 0.7rem;
            text-decoration: none;
        }
        
        .nav-item i {
            font-size: 1.25rem;
            margin-bottom: 4px;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        /* 提示消息 */
        .toast {
            position: fixed;
            top: 60px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            font-size: 0.9rem;
            z-index: 9999;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast.show {
            opacity: 1;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-btn" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">约会详情</div>
        <button class="nav-btn" id="shareBtn">
            <i class="fas fa-share-alt"></i>
        </button>
    </div>
    
    <!-- 图片轮播 -->
    <div class="image-slider" id="imageSlider">
        <div class="slider-item active">
            <img src="https://picsum.photos/id/292/800/600" alt="日式料理">
        </div>
        <div class="slider-item">
            <img src="https://picsum.photos/id/431/800/600" alt="餐厅环境">
        </div>
        <div class="slider-item">
            <img src="https://picsum.photos/id/365/800/600" alt="特色菜品">
        </div>
        <div class="slider-indicators">
            <div class="slider-dot active"></div>
            <div class="slider-dot"></div>
            <div class="slider-dot"></div>
        </div>
        <div class="image-count">1/3</div>
    </div>
    
    <!-- 约会详情卡片 -->
    <div class="date-card">
        <div class="date-status">可报名</div>
        <h1 class="date-title">周末日式料理品鉴会</h1>
        
        <div class="host-info">
            <img src="https://picsum.photos/id/64/100/100" alt="发起人头像" class="host-avatar">
            <div>
                <div>
                    <span class="host-name">美食探险家</span>
                    <span class="host-badge">发起人</span>
                </div>
                <div style="font-size: 0.8rem; color: var(--text-secondary);">已组织28场活动</div>
            </div>
        </div>
        
        <div class="date-meta">
            <div class="meta-item">
                <i class="far fa-calendar-alt"></i>
                <span>周六 18:30-21:00</span>
            </div>
            <div class="meta-item">
                <i class="fas fa-map-marker-alt"></i>
                <span>朝阳区 樱花日料店</span>
            </div>
            <div class="meta-item">
                <i class="fas fa-users"></i>
                <span>4/8人 已报名</span>
            </div>
            <div class="meta-item">
                <i class="fas fa-wallet"></i>
                <span>¥268/人</span>
            </div>
        </div>
        
        <p class="date-description">
            一起探索新开的日式料理店，品尝正宗寿司和刺身，店内环境优雅，适合拍照打卡。
            本次活动将由日料厨师现场讲解日本饮食文化，教大家如何正确品尝寿司。
            适合喜欢美食和想要结交新朋友的小伙伴参加。
        </p>
        
        <div class="date-tags">
            <span class="date-tag">美食聚餐</span>
            <span class="date-tag">日式料理</span>
            <span class="date-tag">新朋友</span>
            <span class="date-tag">文化体验</span>
        </div>
    </div>
    
    <!-- 操作按钮区 -->
    <div class="action-buttons">
        <button class="action-btn icon-action" id="likeBtn">
            <i class="far fa-heart"></i>
        </button>
        <button class="action-btn icon-action" id="collectBtn">
            <i class="far fa-bookmark"></i>
        </button>
        <button class="action-btn secondary-action" id="shareActionBtn">
            <i class="fas fa-share-alt"></i>
            <span>分享</span>
        </button>
        <button class="action-btn primary-action" id="joinBtn">
            <i class="fas fa-user-plus"></i>
            <span>立即报名</span>
        </button>
    </div>
    
    <!-- 内容标签页 -->
    <div class="content-tabs">
        <div class="content-tab active" data-tab="participants">参与者</div>
        <div class="content-tab" data-tab="details">详情</div>
        <div class="content-tab" data-tab="comments">留言 (12)</div>
    </div>
    
    <!-- 参与者面板 -->
    <div class="content-panel active" id="participants-panel">
        <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;">
            <div style="font-weight: 600;">已报名 (4/8)</div>
            <button class="btn btn-sm btn-outline-primary" style="font-size: 0.8rem;">查看全部</button>
        </div>
        
        <div class="participants-list">
            <div class="participant-item host">
                <img src="https://picsum.photos/id/64/100/100" alt="发起人" class="participant-avatar">
                <div class="participant-name">美食探险家</div>
                <div class="participant-status">发起人</div>
            </div>
            
            <div class="participant-item">
                <img src="https://picsum.photos/id/65/100/100" alt="参与者" class="participant-avatar">
                <div class="participant-name">寿司爱好者</div>
                <div class="participant-status">已报名</div>
            </div>
            
            <div class="participant-item">
                <img src="https://picsum.photos/id/66/100/100" alt="参与者" class="participant-avatar">
                <div class="participant-name">东京留学僧</div>
                <div class="participant-status">已报名</div>
            </div>
            
            <div class="participant-item">
                <img src="https://picsum.photos/id/67/100/100" alt="参与者" class="participant-avatar">
                <div class="participant-name">吃货小公举</div>
                <div class="participant-status">已报名</div>
            </div>
        </div>
        
        <div class="detail-section">
            <div class="detail-title">报名须知</div>
            <div class="detail-content">
                <p>1. 报名成功后请在活动前一天确认出席状态</p>
                <p>2. 如需取消，请提前24小时告知，否则费用不退</p>
                <p>3. 活动当天请准时到达，迟到15分钟视为自动放弃</p>
                <p>4. 建议提前了解日料基本礼仪，尊重饮食文化</p>
            </div>
        </div>
    </div>
    
    <!-- 详情面板 -->
    <div class="content-panel" id="details-panel">
        <div class="detail-section">
            <div class="detail-title">活动详情</div>
            <div class="detail-content">
                <p>本次活动将带大家体验正宗的日式料理，包括：</p>
                <p>• 前菜：日式沙拉、温泉蛋</p>
                <p>• 刺身：三文鱼、金枪鱼、北极贝拼盘</p>
                <p>• 寿司：手握寿司8贯（厨师特制）</p>
                <p>• 烤物：盐烤青花鱼</p>
                <p>• 主食：鳗鱼饭</p>
                <p>• 甜品：抹茶冰淇淋</p>
                <p>• 饮料：日本清酒或软饮（可选）</p>
                <p style="margin-top: 10px;">活动过程中，厨师会讲解每种料理的特点和正确品尝方式，让大家不仅吃得开心，还能学到知识。</p>
            </div>
        </div>
        
        <div class="detail-section">
            <div class="detail-title">活动流程</div>
            <div class="detail-content">
                <p>18:30 - 签到入场，自由交流</p>
                <p>19:00 - 活动开始，自我介绍</p>
                <p>19:15 - 料理品尝与文化讲解</p>
                <p>20:30 - 互动游戏，增进了解</p>
                <p>21:00 - 活动结束，合影留念</p>
            </div>
        </div>
        
        <div class="detail-section">
            <div class="detail-title">地点信息</div>
            <div class="detail-content">
                <p>樱花日料店（朝阳大悦城店）</p>
                <p>地址：北京市朝阳区朝阳北路101号朝阳大悦城5层</p>
                <p>交通：地铁6号线青年路站B口出，步行5分钟</p>
                
                <div class="location-map">
                    <img src="https://picsum.photos/id/101/800/600" alt="地图">
                    <i class="fas fa-map-marker-alt map-pin"></i>
                </div>
                
                <button class="btn btn-sm btn-outline-primary w-100">
                    <i class="fas fa-map-marker-alt"></i> 导航到这里
                </button>
            </div>
        </div>
        
        <div class="detail-section">
            <div class="detail-title">费用说明</div>
            <div class="detail-content">
                <p>费用包含：所有料理品尝、饮料、活动组织费</p>
                <p>费用不含：往返交通、个人额外消费</p>
                <p>支付方式：报名后通过平台支付，不支持现场付款</p>
                <p>退款政策：活动前24小时可全额退款，24小时内不支持退款</p>
            </div>
        </div>
    </div>
    
    <!-- 留言面板 -->
    <div class="content-panel" id="comments-panel">
        <div class="comments-list">
            <div class="comment-item">
                <img src="https://picsum.photos/id/65/100/100" alt="用户头像" class="comment-avatar">
                <div class="comment-content">
                    <div class="comment-header">
                        <div class="comment-author">寿司爱好者</div>
                        <div class="comment-time">昨天 15:30</div>
                    </div>
                    <div class="comment-text">这家店我去过一次，他们家的三文鱼非常新鲜，推荐大家尝试！</div>
                    <div class="comment-actions">
                        <button class="comment-action">
                            <i class="far fa-heart"></i>
                            <span>12</span>
                        </button>
                        <button class="comment-action reply-btn">
                            <i class="far fa-comment"></i>
                            <span>回复</span>
                        </button>
                    </div>
                    
                    <div class="replies-list">
                        <div class="reply-item">
                            <img src="https://picsum.photos/id/64/100/100" alt="用户头像" class="comment-avatar" style="width: 30px; height: 30px;">
                            <div class="reply-content">
                                <div>
                                    <span class="reply-author">美食探险家</span>
                                </div>
                                <div class="reply-text">是的，他们家的海鲜都是每日新鲜配送的，品质有保证</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="comment-item">
                <img src="https://picsum.photos/id/68/100/100" alt="用户头像" class="comment-avatar">
                <div class="comment-content">
                    <div class="comment-header">
                        <div class="comment-author">酒仙儿</div>
                        <div class="comment-time">昨天 10:15</div>
                    </div>
                    <div class="comment-text">请问可以自带酒水吗？我有一瓶不错的清酒想和大家分享</div>
                    <div class="comment-actions">
                        <button class="comment-action">
                            <i class="far fa-heart"></i>
                            <span>3</span>
                        </button>
                        <button class="comment-action reply-btn">
                            <i class="far fa-comment"></i>
                            <span>回复</span>
                        </button>
                    </div>
                </div>
            </div>
            
            <div class="comment-item">
                <img src="https://picsum.photos/id/69/100/100" alt="用户头像" class="comment-avatar">
                <div class="comment-content">
                    <div class="comment-header">
                        <div class="comment-author">素食主义者</div>
                        <div class="comment-time">2天前</div>
                    </div>
                    <div class="comment-text">有素食选项吗？我不吃生鱼片</div>
                    <div class="comment-actions">
                        <button class="comment-action">
                            <i class="far fa-heart"></i>
                            <span>5</span>
                        </button>
                        <button class="comment-action reply-btn">
                            <i class="far fa-comment"></i>
                            <span>回复</span>
                        </button>
                    </div>
                    
                    <div class="replies-list">
                        <div class="reply-item">
                            <img src="https://picsum.photos/id/64/100/100" alt="用户头像" class="comment-avatar" style="width: 30px; height: 30px;">
                            <div class="reply-content">
                                <div>
                                    <span class="reply-author">美食探险家</span>
                                </div>
                                <div class="reply-text">有的，可以提前告知，我们会为您准备素食套餐</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 留言输入框 -->
    <div class="comment-input-container">
        <img src="https://picsum.photos/id/70/100/100" alt="你的头像" class="comment-avatar">
        <div class="comment-input-wrapper">
            <input type="text" class="comment-input" placeholder="分享你的想法...">
            <button class="send-comment">
                <i class="fas fa-paper-plane"></i>
            </button>
        </div>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-calendar-alt"></i>
            <span>约会</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-compass"></i>
            <span>发现</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-comment"></i>
            <span>消息</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-user"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- 提示消息 -->
    <div class="toast" id="toastMessage"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // DOM元素
        const backBtn = document.getElementById('backBtn');
        const shareBtn = document.getElementById('shareBtn');
        const shareActionBtn = document.getElementById('shareActionBtn');
        const likeBtn = document.getElementById('likeBtn');
        const collectBtn = document.getElementById('collectBtn');
        const joinBtn = document.getElementById('joinBtn');
        const contentTabs = document.querySelectorAll('.content-tab');
        const contentPanels = document.querySelectorAll('.content-panel');
        const replyBtns = document.querySelectorAll('.reply-btn');
        const sendCommentBtn = document.querySelector('.send-comment');
        const commentInput = document.querySelector('.comment-input');
        const imageSlider = document.getElementById('imageSlider');
        const sliderItems = document.querySelectorAll('.slider-item');
        const sliderDots = document.querySelectorAll('.slider-dot');
        const imageCount = document.querySelector('.image-count');
        const toastMessage = document.getElementById('toastMessage');
        
        // 轮播图索引
        let currentSlide = 0;
        let slideInterval;
        
        // 初始化
        function init() {
            setupEventListeners();
            startImageSlider();
        }
        
        // 设置事件监听
        function setupEventListeners() {
            // 返回按钮
            backBtn.addEventListener('click', () => {
                history.back();
                showToast('返回列表');
            });
            
            // 分享按钮
            shareBtn.addEventListener('click', () => {
                showToast('分享成功');
            });
            
            shareActionBtn.addEventListener('click', () => {
                showToast('分享成功');
            });
            
            // 点赞按钮
            likeBtn.addEventListener('click', function() {
                this.querySelector('i').classList.toggle('far');
                this.querySelector('i').classList.toggle('fas');
                this.querySelector('i').classList.toggle('text-danger');
                
                const isLiked = this.querySelector('i').classList.contains('fas');
                showToast(isLiked ? '已点赞' : '取消点赞');
            });
            
            // 收藏按钮
            collectBtn.addEventListener('click', function() {
                this.querySelector('i').classList.toggle('far');
                this.querySelector('i').classList.toggle('fas');
                this.querySelector('i').classList.toggle('text-primary');
                
                const isCollected = this.querySelector('i').classList.contains('fas');
                showToast(isCollected ? '已收藏' : '取消收藏');
            });
            
            // 报名按钮
            joinBtn.addEventListener('click', () => {
                showToast('报名成功，请留意活动通知');
                joinBtn.innerHTML = '<i class="fas fa-check"></i><span>已报名</span>';
                joinBtn.disabled = true;
                joinBtn.style.opacity = '0.8';
            });
            
            // 内容标签页切换
            contentTabs.forEach(tab => {
                tab.addEventListener('click', () => {
                    const tabId = tab.getAttribute('data-tab');
                    
                    contentTabs.forEach(t => t.classList.remove('active'));
                    tab.classList.add('active');
                    
                    contentPanels.forEach(panel => {
                        panel.classList.remove('active');
                    });
                    document.getElementById(`${tabId}-panel`).classList.add('active');
                });
            });
            
            // 回复按钮
            replyBtns.forEach(btn => {
                btn.addEventListener('click', function() {
                    const author = this.closest('.comment-content').querySelector('.comment-author').textContent;
                    commentInput.value = `回复 @${author}：`;
                    commentInput.focus();
                });
            });
            
            // 发送评论
            sendCommentBtn.addEventListener('click', sendComment);
            
            // 回车发送评论
            commentInput.addEventListener('keypress', function(e) {
                if (e.key === 'Enter') {
                    sendComment();
                }
            });
            
            // 轮播图点击切换
            sliderDots.forEach((dot, index) => {
                dot.addEventListener('click', () => {
                    goToSlide(index);
                });
            });
            
            // 图片点击放大查看
            imageSlider.addEventListener('click', () => {
                showToast('图片预览功能');
            });
        }
        
        // 轮播图控制
        function startImageSlider() {
            slideInterval = setInterval(nextSlide, 5000);
        }
        
        function nextSlide() {
            currentSlide = (currentSlide + 1) % sliderItems.length;
            updateSlider();
        }
        
        function goToSlide(index) {
            currentSlide = index;
            updateSlider();
            // 重置轮播计时器
            clearInterval(slideInterval);
            startImageSlider();
        }
        
        function updateSlider() {
            sliderItems.forEach((item, index) => {
                item.classList.toggle('active', index === currentSlide);
            });
            
            sliderDots.forEach((dot, index) => {
                dot.classList.toggle('active', index === currentSlide);
            });
            
            imageCount.textContent = `${currentSlide + 1}/${sliderItems.length}`;
        }
        
        // 发送评论
        function sendComment() {
            const commentText = commentInput.value.trim();
            if (!commentText) return;
            
            // 创建新评论元素
            const newComment = document.createElement('div');
            newComment.className = 'comment-item';
            newComment.innerHTML = `
                <img src="https://picsum.photos/id/70/100/100" alt="你的头像" class="comment-avatar">
                <div class="comment-content">
                    <div class="comment-header">
                        <div class="comment-author">我</div>
                        <div class="comment-time">刚刚</div>
                    </div>
                    <div class="comment-text">${commentText}</div>
                    <div class="comment-actions">
                        <button class="comment-action">
                            <i class="far fa-heart"></i>
                            <span>0</span>
                        </button>
                        <button class="comment-action reply-btn">
                            <i class="far fa-comment"></i>
                            <span>回复</span>
                        </button>
                    </div>
                </div>
            `;
            
            // 添加到评论列表顶部
            const commentsList = document.querySelector('.comments-list');
            commentsList.insertBefore(newComment, commentsList.firstChild);
            
            // 绑定新评论的回复按钮事件
            newComment.querySelector('.reply-btn').addEventListener('click', function() {
                const author = this.closest('.comment-content').querySelector('.comment-author').textContent;
                commentInput.value = `回复 @${author}：`;
                commentInput.focus();
            });
            
            // 清空输入框
            commentInput.value = '';
            
            // 更新评论数量
            const commentTab = document.querySelector('.content-tab[data-tab="comments"]');
            const currentCount = parseInt(commentTab.textContent.match(/\d+/)[0]);
            commentTab.textContent = `留言 (${currentCount + 1})`;
            
            showToast('评论成功');
        }
        
        // 显示提示消息
        function showToast(message) {
            toastMessage.textContent = message;
            toastMessage.classList.add('show');
            setTimeout(() => {
                toastMessage.classList.remove('show');
            }, 2000);
        }
        
        // 初始化页面
        document.addEventListener('DOMContentLoaded', init);
    </script>
</body>
</html>
